import { defineConfig } from 'wxt';

// 参考 https://wxt.dev/api/config.html
export default defineConfig({
  outDir: 'dist',
  manifest: {
    name: 'KikiMami WhatsApp Tool',
    description: 'KikiMami WhatsApp 助手',
    version: '3.0.0',
    permissions: [
      'storage',
      'cookies',
      'tabs',
      'scripting'
    ],
    host_permissions: [
              'https://web.whatsapp.com/*',
        'https://tools.kikimami.com/*',
        '*://*.erp.lianf.com/*'
    ],
    action: {
      default_popup: 'popup.html'
    },
    web_accessible_resources: [{
      resources: [
        'lib/marked.min.js',
        'whatsapp-injected.js',
        'whatsapp-userid.js'
      ],
      matches: ['https://web.whatsapp.com/*']
    }],
    content_scripts: [
      {
        matches: ['https://web.whatsapp.com/*'],
        js: ['content-scripts/whatsapp.js', 'content-scripts/erp.js']
      },
      {
        matches: ['https://web.whatsapp.com/*', 'https://tools.kikimami.com/*'],
        js: ['content-scripts/auth.js']
      }
    ]
    // 注意：content_scripts 会由 WXT 根据 entrypoints 目录中的文件自动生成
    // 不需要在这里手动配置
  },
  extensionApi: 'chrome',
  modules: ['@wxt-dev/module-vue']
});
